
public class Test {
    public static void main(String[] args) {
        int[] array = {1, 2, 34, 3, 4, 5, 7, 23, 12};
        System.out.println(fun(array));
    }

    public static boolean fun(int[] array) {
        int count = 0;
        for (int i : array) {
            if (i % 2 != 0) {
                count++;
                if (count == 3) {
                    return true;
                }
            } else {
                count = 0;
            }
        }
        return false;
    }

}
